package com.aspose.cells;

class zaiy {
   private zoz a = null;
   private CustomDocumentPropertyCollection b = null;
   private static final com.aspose.cells.b.c.a.za c = new com.aspose.cells.b.c.a.za(new String[]{"filetime", "i1", "i2", "i4", "r4", "r8", "bool", "lpwstr"});

   zaiy(zoz var1) {
      this.a = var1;
      this.b = this.a.a.getWorksheets().getCustomDocumentProperties();
   }

   void a(zcfw var1) throws Exception {
      this.c(var1);
      if (!var1.n()) {
         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else if ("property".equals(var1.p())) {
               this.b(var1);
            } else {
               var1.a();
            }
         }

      }
   }

   void b(zcfw var1) throws Exception {
      String var2 = var1.a("name");
      if (!var1.n() && var2 != null && var2.length() != 0) {
         DocumentProperty var3 = null;
         String var4 = var1.a("linkTarget");
         if (var4 != null) {
            var3 = this.b.addLinkToContent(var2, var4);
         }

         var1.d();

         while(var1.r() != 4) {
            var1.j();
            if (var1.r() != 1) {
               var1.a();
            } else {
               String var5 = var1.p();
               String var6 = var1.a(true);
               this.a(var3, var2, var6, var5);
            }
         }

         var1.h();
      } else {
         var1.a();
      }
   }

   private void a(DocumentProperty var1, String var2, String var3, String var4) {
      try {
         switch(c.a(var4)) {
         case 0:
            DateTime var5 = DateTime.a(var3, "yyyy-MM-dd\\THH:mm:ss\\Z", com.aspose.cells.b.a.c.za.b());
            if (var1 == null) {
               this.b.add(var2, com.aspose.cells.a.c.zk.a(var3));
            } else {
               var1.setValue(com.aspose.cells.a.c.zk.a(var3));
            }
            break;
         case 1:
         case 2:
         case 3:
            int var6 = zase.C(var3);
            if (var1 == null) {
               this.b.add(var2, var6);
            } else {
               var1.setValue(var6);
            }
            break;
         case 4:
         case 5:
            double var7 = zase.B(var3);
            if (var1 == null) {
               this.b.add(var2, var7);
            } else {
               var1.setValue(var7);
            }
            break;
         case 6:
            boolean var9 = var3.toLowerCase().equals("true");
            if (var1 == null) {
               this.b.add(var2, var9);
            } else {
               var1.setValue(var9);
            }
            break;
         case 7:
         default:
            if (var1 == null) {
               this.b.add(var2, var3);
            } else {
               var1.setValue(var3);
            }
         }
      } catch (Exception var10) {
         if (var1 == null) {
            this.b.add(var2, var3);
         } else {
            var1.setValue(var3);
         }
      }

   }

   private void c(zcfw var1) throws Exception {
      var1.f = false;
      var1.j();
      if (var1.r() != 1 || !"Properties".equals(var1.p())) {
         throw new CellsException(6, "DocPropsCustom root element eror");
      }
   }
}
